package com.text5;


import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

public class Fun1 {
    public static void main(String[] args) throws SQLException {
        NewsDaoImpl newsDao=new NewsDaoImpl();



        //查
       /* List<News> newsList=newsDao.getNewsList();
        for(News news:newsList){
            System.out.println(news.getId()+"\t"+news.getTitle()+"\t"+news.getSummary()+"\t"+news.getContent()+"\t"+news.getAuthor()+"\t"+news.getCreateDate());
        }*/



        //增
       /* News news = new News();
        news.setCategoryId(2);
        news.setTitle("dfsdfgdfggfdgfdgfdg");
        news.setSummary("1");
        news.setContent("2");
        news.setCreateDate(new Date());
        newsDao.add(news);*/



        //删
       /* newsDao.delete(5);*/


        //改
        News news1 = new News();
        news1.setTitle("食物");
        news1.setId(6);

        newsDao.update(news1);
    }


}
